package com.beyondsoft.mcms.common;

public class ExcelDataElement<T> {

	public static final short FONT_SIZE_16 = 16;
	public static final short FONT_SIZE_14 = 14;
	public static final short FONT_SIZE_11 = 11;
	public static final short FONT_SIZE_10 = 10;
	private T data;

	private int mergedCells;

	private short fontSize;

	private boolean bold;

	private String pattern;

	public ExcelDataElement(T data) {
		this(data, 0);
	}

	public ExcelDataElement(T data, String pattern) {
		this(data, null, null, false, pattern);
	}

	public ExcelDataElement(T data, Integer mergedCells) {
		this(data, mergedCells, null);
	}

	public ExcelDataElement(T data, Integer mergedCells, Short fontSize) {
		this(data, mergedCells, fontSize, false);
	}

	public ExcelDataElement(T data, Integer mergedCells, Short fontSize, boolean bold) {
		this(data, mergedCells, fontSize, false, null);
	}

	public ExcelDataElement(T data, Integer mergedCells, Short fontSize, boolean bold, String pattern) {
		this.data = data;
		this.mergedCells = mergedCells == null ? 0 : mergedCells;
		this.fontSize = fontSize == null ? FONT_SIZE_10 : fontSize;
		this.bold = bold;
		this.pattern = pattern;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public int getMergedCells() {
		return mergedCells;
	}

	public void setMergedCells(int mergedCells) {
		this.mergedCells = mergedCells;
	}

	public short getFontSize() {
		return fontSize;
	}

	public void setFontSize(short fontSize) {
		this.fontSize = fontSize;
	}

	@Override
	public String toString() {
		return this.data.toString() + "  " + this.mergedCells;
	}

	public boolean isBold() {
		return bold;
	}

	public void setBold(boolean bold) {
		this.bold = bold;
	}

	public String getPattern() {
		return pattern;
	}

	public void setPattern(String pattern) {
		this.pattern = pattern;
	}

}
